package cn.edu.javaweb.superServlet;

import java.io.IOException;

import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import cn.edu.javaweb.javabean.Notice;
import cn.edu.javaweb.service.NoticeService;


@WebServlet("/SelectNotice")
public class SelectNotice extends HttpServlet {
	private static final long serialVersionUID = 1L;
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=utf-8");
		NoticeService Notice =new NoticeService();
		
		List<Notice> NoticeList = Notice.getNotices(); 
        request.setAttribute("Notice",NoticeList);
        System.out.println(NoticeList);

        request.getRequestDispatcher("volunteer/super/NoticeAdmin.jsp").forward(request, response);
	}

	
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		this.doGet(request, response); 
	}
}
